//WMPPlus.h
#include <shlobj.h>
#include "WMPPlusCore.h"
#include "WMPPlusPublic.h"
#include "WMPMenu.h"
#include "WMPUIAddons.h"

#pragma once

class WMPPlus: public WMPPlusPublic {
	HHOOK hookGetMessage;
	HHOOK hookCallWndProc;
	HHOOK hookCallWndProcRet;
	UINT msgPluginAddRemove;
	IShellFolder* shell;
public:
	inline HHOOK getGetMessageHook() { return this->hookGetMessage; }
	inline void setGetMessageHook(HHOOK hook) { this->hookGetMessage = hook; }
	inline HHOOK getCallWndProcHook() { return this->hookCallWndProc; }
	inline void setCallWndProcHook(HHOOK hook) { this->hookCallWndProc = hook; }
	inline HHOOK getCallWndProcRetHook() { return this->hookCallWndProcRet; }
	inline void setCallWndProcRetHook(HHOOK hook) { this->hookCallWndProcRet = hook; }
	WMPMenu* Menu;
	WMPUIAddons* Addons;
	inline HMENU getLibraryMenu() { return (HMENU)Core->getPtrProp(WMPPLUS_PROPERTY_LIBMENU); }
	inline void setLibraryMenu(HMENU hMenu) { Core->setPtrProp(WMPPLUS_PROPERTY_LIBMENU, hMenu); }
	inline int getPluginAddRemoveMsg() { return this->msgPluginAddRemove; }
	inline void setPluginAddRemoveMsg(int msg) { this->msgPluginAddRemove = msg; }
	inline IShellFolder* getDesktopShellFolder() { return this->shell; }

	WMPPlus();
	~WMPPlus();
	void Initialize();
	void Dispose();
	void HookLibraryWindowProc(bool arg);
	void HookLibraryWindowProc(HWND hWnd, CREATESTRUCT* info);
	void HookWMP();
	void InitPopupMenu(HWND hWnd, HMENU hMenu);
	void UninitPopupMenu(HWND hWnd, HMENU hMenu);
};
extern WMPPlus* Plugin;

void WINAPI WMPPlusInitialize(WMPMenu* &menu);
void WINAPI WMPPlusDispose();
bool ResolveMediaFolder(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl);
